package com.gkzf.ai.module.crm.controller.admin.product.vo.product;

import com.gkzf.ai.module.crm.controller.admin.product.vo.productadmittancecondition.ProductAdmittanceConditionSaveReqVO;
import com.gkzf.ai.module.crm.controller.admin.product.vo.repayment.CrmProductRepaymentSaveReqVO;
import com.gkzf.ai.module.crm.enums.DictTypeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * @author Huawei
 * 2025-04-08 18:22
 */
@Schema(description = "管理后台 - CRM 产品创建/修改 Request VO")
@Data
public class CrmProductReqVO {

    /**
     * 编号
     */
    @Schema(description = "产品id", example = "32493")
    private Long id;
    /**
     * 产品名称
     */
    @Schema(description = "产品名称", example = "产品名称")
    @NotEmpty(message = "产品名称不能为空")
    private String name;
    /**
     * 产品编码
     */
    private String no;
    /**
     * 贷款类型
     */
    @Schema(description = "贷款类型 0：信用度  1：抵押贷", example = "0")
    @NotNull(message = "贷款类型不能为空")
    private String loanType;

    @Schema(description = "还款方式", example = "{}")
    @Size(min = 1,message = "还款方式不能为空")
    private List<CrmProductRepaymentSaveReqVO> repaymentList;
    /**
     * 贷款期限
     * 字典 {@link DictTypeConstants#CRM_PRODUCT_UNIT}
     */
    @Schema(description = "贷款期限(月)", example = "4")
    @NotNull(message = "贷款期限不能为空")
    private Integer loansDeadline;
    /**
     * 最大限额
     */
    @Schema(description = "最高限额(万元)", example = "100")
    @NotNull(message = "最高限额不能为空")
    private BigDecimal maxQuota;
    /**
     * 办理周期
     */
    @Schema(description = "办理周期", example = "30")
    @NotNull(message = "办理周期不能为空")
    private Integer processingCycle;
    /**
     * 下款方式 0：自主  1：第三方
     */
    @Schema(description = "下款方式0：自主  1：第三方", example = "0")
    @NotEmpty(message = "下款方式不能为空")
    private String payeeWay;
    /**
     * 利率
     */
    @Schema(description = "利率(%)", example = "3.23")
    @NotNull(message = "利率(%)不能为空")
    private String interestRate;
    /**
     * 状态 0：有效 1：无效
     */
    @Schema(description = "状态 0：有效 1：无效", example = "0")
    @NotNull(message = "状态不能为空")
    private Integer status;
    /**
     * 产品准备材料
     */
    private String preparedMaterials;
    /**
     * 产品有效期开始时间
     */
    private LocalDate validityPeriodStart;
    /**
     * 产品有效期结束时间
     */
    private LocalDate validityPeriodEnd;
    /**
     * 产品描述 备注
     */
    private String description;
    /**
     * 负责人的用户编号
     * 关联 AdminUserDO 的 id 字段
     */
    private Long ownerUserId;

    @Schema(description = "合作机构 字典配置")
    @NotNull(message = "合作机构不能为空")
    private Integer cooperationInstitution;


    @Schema(description = "额度公式")
    private String quotaFormula;

    @Schema(description = "产品介绍")
    private String descriptions;

    @Schema(description = "产品标签")
    private String label;

    /**
     *  是否推送app端
     */
    @Schema(description = "是否推送app端")
    private Integer isPushRemotely;

    @Schema(description = "申请流程")
    private String applicationProcess;

    /**
     *  是否推送推荐 默认0不推荐  1推荐
     */
    @Schema(description = "是否推送推荐 默认0不推荐  1推荐")
    private Integer isRecommendation;

    @Schema(description = "准入条件对象")
    private ProductAdmittanceConditionSaveReqVO conditionReqVO;
}
